#include <stdio.h>

int main()
{
    FILE* pf = fopen("data.txt", "r");
    if(pf == NULL)
    {
        perror("data.txt:");
        return 1;
    }
    FILE* pe = fopen("data_copy.txt", "w");
    if(pe == NULL)
    {
        perror("data_copy.txt:");
        return 1;
    }
    char ch = 0;
    while((ch = fgetc(pf)) != EOF)
    {
        fputc(ch, pe);
    }
    fclose(pf);pf = NULL;
    fclose(pe);pe = NULL;
    return 0;
}